﻿#include <iostream>

using namespace std;

void put_nchar(char c, int n) {
	while (n--) {
		cout << c;
	}
}

void put_square(int n, char c) {
	for (int i = 1; i <= n; i++) {
		put_nchar(c, n);
		cout << '\n';
	}
}

void put_rectangle(int h, int w, char c) {
	for (int i = 1; i <= h; i++) {
		put_nchar(c, w);
		cout << '\n';
	}
}

int main() {
	int n, h, w;

	cout << "显示正方形\n";
	cout << "边长：";
	cin >> n;

	put_square(n, '*');

	cout << "显示长方形\n";
	cout << "宽：";
	cin >> w;
	cout << "高：";
	cin >> h;

	put_rectangle(h, w, '+');

	cin.get();
	cin.get();
}